Skip to content

fix(runtime): advance idle discovery freshness heartbeat#62

Merged
pureliture merged 4 commits into
mainfrom
codex/idle-freshness-pr
Jun 21, 2026
Merged

fix(runtime): advance idle discovery freshness heartbeat#62
pureliture merged 4 commits into
mainfrom
codex/idle-freshness-pr

Conversation

@pureliture

Copy link
Copy Markdown
Contributor

What

  • Advance REPO_HEALTH.lastSuccessfulIncrementalAt when incremental discovery successfully confirms that a repository has no new incremental work.
  • Keep DISCOVERY_MODE_INITIALIZE, missing cursor, non-fast-forward, and pending-work paths from marking a repository fresh.
  • Add regression coverage for idle skip, unchanged refs, no refs, and all-ledger-skipped paths.

Why

lastSuccessfulIncrementalAt is an incremental discovery heartbeat, not proof that every commit scan completed. When discover-updates --ls-remote-skip or the fetch path confirms no new work, freshness should not report a stale repository solely because it was idle.

Actual scan completion and dedupe proof remain in SCAN_JOB and SCAN_LEDGER. Baseline freshness remains separate through lastSuccessfulFullScanAt.

Review

  • Reviewed locally by codebase_architecture_manager; initial initialize/no-refs blocker was fixed.
  • Reviewed locally by system_architecture_manager; no remaining system-level blocker.

Verification

  • uv run ruff check src/security_scanner/runtime/incremental_discovery.py tests/test_incremental_discovery.py tests/test_m4_poll_baseline.py
  • uv run pytest tests/test_incremental_discovery.py tests/test_m4_poll_baseline.py tests/test_cli_timer_entrypoints.py tests/test_repo_health_freshness.py
  • uv run pytest

Closes #61

ls-remote에서 변경 없음이 확인되거나 fetch 후 새 작업이 없는 repository도 incremental health를 전진시켜 freshness 평가가 실제 지속 점검 의미와 맞도록 한다. 새 job, missing cursor, non-fast-forward 경로는 기존처럼 worker/후속 검증에 맡긴다.

검증:
- uv run ruff check src/security_scanner/runtime/incremental_discovery.py tests/test_incremental_discovery.py tests/test_m4_poll_baseline.py
- uv run pytest

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
@pureliture pureliture added the type:bug Bug work item label Jun 21, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the incremental discovery process to track skipped idle targets and conditionally advance repository health when running in enqueue mode, ensuring repositories are marked as incrementally fresh when no new work is observed. The reviewer suggests wrapping the advance_repo_health calls in try-except blocks to prevent transient database failures from aborting the discovery process, as these are best-effort, non-transactional operations.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/security_scanner/runtime/incremental_discovery.py
Comment thread src/security_scanner/runtime/incremental_discovery.py Outdated
Comment thread src/security_scanner/runtime/incremental_discovery.py Outdated
pureliture and others added 3 commits June 22, 2026 07:13
incremental discovery heartbeat write 실패가 전체 discovery 실행을 중단하지 않도록 best-effort helper로 격리한다. transient REPO_HEALTH write failure가 있어도 scan job discovery와 ref observation 본류는 계속 진행된다.

검증:
- uv run ruff check src/security_scanner/runtime/incremental_discovery.py tests/test_incremental_discovery.py tests/test_m4_poll_baseline.py
- uv run pytest tests/test_incremental_discovery.py tests/test_m4_poll_baseline.py tests/test_cli_timer_entrypoints.py tests/test_repo_health_freshness.py
- uv run pytest

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
PR branch에 main merge commit이 추가된 뒤 GitHub required checks가 새 head에 붙지 않아 branch policy가 merge를 차단했다. 빈 commit으로 pull_request synchronize 이벤트를 발생시켜 동일 diff에 대해 required checks를 재실행한다.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
@pureliture pureliture merged commit bc96453 into main Jun 21, 2026
9 checks passed
@pureliture pureliture deleted the codex/idle-freshness-pr branch June 21, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Bug work item

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: idle repository freshness false breach 보정

1 participant